package com.iyundao.io.mapper;

import com.iyundao.io.model.Wish;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WishMapper {
    @Insert({
        "insert into wish (id, giftid, ",
        "partymemberid)",
        "values (#{id,jdbcType=INTEGER}, #{giftid,jdbcType=INTEGER}, ",
        "#{partymemberid,jdbcType=VARCHAR})"
    })
    int insert(Wish record);

    @InsertProvider(type= WishSqlProvider.class, method="insertSelective")
    int insertSelective(Wish record);

    @Select("select count(*) from wish where giftid=#{giftid,jdbcType=INTEGER} and partymemberid=#{partymemberid,jdbcType=VARCHAR}")
    int selectExist(Wish wish);




}